﻿using BBCore.Application.OracleApplication.ZDL.Interface;
using BBCore.Core.Models.OracleEntity;
using BootstrapBlazor.Components;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace BBCore.Application.OracleApplication.ZDL.Service
{
    public class ORGService : IORGService
    {
        private readonly IFreeSql FreeSql;
        public ORGService(IFreeSql freeSql) => FreeSql = freeSql;

        public List<SelectedItem> GetOrg()
        {
            var Items = FreeSql.Select<ZDL_HYJ_ONLINE_ORG>().Distinct().ToList(a => new SelectedItem { Value = a.ORG_ID.ToString(), Text = a.ORG_CODE.ToString() });
            Items.Insert(0, new SelectedItem { Value = "", Text = "请选择..." });
            return Items;
        }

    }
}
